package com.hundredapp.oa.repository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.hundredapp.oa.dao.GenericDao;
import com.hundredapp.oa.domain.OaSlow;
import com.hundredapp.oa.domain.OaStudent;
import com.hundredapp.oa.domain.OaSubject;

@Repository
public class SlowMangerImpl implements SlowManager {
	
	@Autowired
	private GenericDao<OaSlow, Integer> slowDao;
	@Autowired
	private GenericDao<OaStudent, Integer> studentDao;
	@Autowired
	private GenericDao<OaSubject, Integer> subjectDao;

	@Override
	public int add(OaSlow slow) {
		return slowDao.save(slow);
	}

	@Override
	public List<OaSlow> findSlows(String condition, int start, int limit) {
		return slowDao.find(condition, start, limit);
	}

	@Override
	public OaSlow findSlowById(int id) {
		return slowDao.findById(id);
	}

	@Override
	public void delete(int id) {
		slowDao.remove(slowDao.findById(id));
	}

	@Override
	public void update(OaSlow slow) {
		slowDao.modify(slow);
	}

	@Override
	public int count(String condition) {
		return slowDao.count(condition);
	}

}
